﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;

namespace Hellquest
{
    public class TestControler : Component
    {
        public TestControler()
        {

        }

        public override void Update(GameTime _gameTime)
        {
            if (InputHandler.KeyDown(Keys.W))
                gameObject.rigidbody.ApplyForce(new Vector2(0, -200));

            if (InputHandler.KeyDown(Keys.S))
                gameObject.rigidbody.ApplyForce(new Vector2(0, 200));

            if (InputHandler.KeyDown(Keys.A))
                gameObject.rigidbody.ApplyForce(new Vector2(-200, 0));

            if (InputHandler.KeyDown(Keys.D))
                gameObject.rigidbody.ApplyForce(new Vector2(200, 0));

            if (InputHandler.KeyDown(Keys.Up))
                gameObject.transform.Rotation += 1f * (float)_gameTime.ElapsedGameTime.TotalSeconds;
        }
    }
}
